<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title>Untitled Document</title>
		<script type="text/javascript">var CTP_WEB_FULLPATH = "../../"</script>
        <script type="text/javascript" src="../../js/jquery/jquery.js">
        </script>
        <script type="text/javascript" src="../../js/jquery/jquery-migrate.js">
        </script>
        <script type="text/javascript" src="../../js/jqueryui/jquery-ui.js">
        </script>
        <script type="text/javascript" src="../../js/ctp/public/jsextend.js">
        </script>
        <script type="text/javascript" src="../../js/ctp/public/ctp.core.js">
        </script>
		<script type="text/javascript" src="../../js/ctp/public/ctp.base.js">
        </script>
		<script type="text/javascript" src="../../js/ctp/public/ctp.ui.component.js">
        </script>
        <script type="text/javascript" src="../../js/ctp/panel/ctp.ui.panel.js">
        </script>
        <script type="text/javascript" src="../../js/ctp/button/ctp.ui.button.js">
        </script>
		<script type="text/javascript" src="../../js/ctp/groupbox/ctp.ui.groupbox.js">
		</script>
		<script type="text/javascript" src="../../js/ctp/gridlayout/ctp.ui.gridlayout.js">
        </script>	
        <script type="text/javascript" src="../../js/ctp/statusbar/ctp.ui.statusbar.js">
        </script>	
        
		<script type="text/javascript" src="../../js/ctp/messagebox/ctp.ui.messagebox.js"></script>
        <link href="../../css/skins/standard/ctp-common.css" rel="stylesheet" type="text/css"/>
        <link href="../../css/panel.css" rel="stylesheet" type="text/css"/>
        <link href="../../css/button.css" rel="stylesheet" type="text/css"/>
		<link href="../../css/groupbox.css" rel="stylesheet" type="text/css"/>
		<link href="../../css/gridlayout.css" rel="stylesheet" type="text/css"/>
		<link href="../../css/messagebox.css" rel="stylesheet" type="text/css"/>
		<link href="../../css/statusbar.css" rel="stylesheet" type="text/css"/>

		<script type="text/javascript">
			// ctp.core.log.lvl=ctp.core.loglvl.info;
			var statusbar;
			$(document).ready(	
				function(){
					var button1=new ctp.ui.button({
	                    id: 'button1',
	                    text: '状态条运行3秒',
	                    width: '100%',
	                    onClick: startStatusbar
	                });
	                var button2=new ctp.ui.button({
	                    id: 'button2',
	                    text: '运行状态条',
	                    width: '100%',
	                    onClick: statusbarStart
	                });
					var button3=new ctp.ui.button({
	                    id: 'button3',
	                    text: '测试',
	                    width: '100%',
	                    onClick: function(){
							var test = [];
							test.push('ctpPackage: '+statusbar.ctpPackage+'\n');
							test.push('initSettings: '+statusbar.initSettings+'\n');
							test.push('isContainer: '+statusbar.isContainer+'\n');
							test.push('isHidden: '+statusbar.isHidden+'\n');
							test.push('isNeedRender: '+statusbar.isNeedRender+'\n');
							test.push('isNeedReset: '+statusbar.isNeedReset+'\n');
							test.push('jqDom: '+statusbar.jqDom+'\n');
							//test.push('resize: '+statusbar.resize+'\n');
							test.push('settings: '+statusbar.settings+'\n');
							test.push('type: '+statusbar.type+'\n');
							test.push('version: '+statusbar.version+'\n');
							//test.push('rendered: '+statusbar.rendered+'\n');
							//test.push('renderTo: '+statusbar.renderTo()+'\n');
							//test.push('render: '+statusbar.render()+'\n');
							//test.push('remove: '+statusbar.remove()+'\n');
							alert(test.join(''));
	
							test = [];
							//test.push('afterInit: '+statusbar.afterInit()+'\n');
							//test.push('destroy: '+statusbar.destroy()+'\n');
							test.push('getCtpWebType: '+statusbar.getCtpWebType()+'\n');
							test.push('getDefaultSettings: '+statusbar.getDefaultSettings()+'\n');
							test.push('getDomId: '+statusbar.getDomId()+'\n');
							test.push('getFnContext: '+statusbar.getFnContext()+'\n');
							test.push('getHeight: '+statusbar.getHeight()+'\n');
							test.push('getId: '+statusbar.getId()+'\n');
							test.push('getInitSettings: '+statusbar.getInitSettings()+'\n');
							test.push('getJqDom: '+statusbar.getJqDom()+'\n');
							test.push('getName: '+statusbar.getName()+'\n');
							test.push('getPkgContext: '+statusbar.getPkgContext()+'\n');
							test.push('getSettings: '+statusbar.getSettings()+'\n');
							test.push('getWidth: '+statusbar.getWidth()+'\n');
							test.push('hide: '+statusbar.hide()+'\n');
							alert('hide')
							//test.push('init: '+statusbar.init()+'\n');
							test.push('removeJqDoms: '+statusbar.removeJqDoms()+'\n');
							test.push('setWidth: '+statusbar.setWidth('400px')+ ' ' + (statusbar.getWidth()==400) +'\n');
							test.push('setHeight: '+statusbar.setHeight('50px')+ ' ' + (statusbar.getHeight()==50) + '\n');
							test.push('setSize: '+statusbar.setSize('60px','50px')+ ' ' + (statusbar.getHeight()==50 && statusbar.getWidth()==60) + '\n');
							test.push('show: '+statusbar.show()+'\n');
							alert(test.join(''));
	
							test = [];
							test.push('setEndVisible: '+statusbar.setEndVisible(true)+'\n');
							test.push('setDefText: '+statusbar.setDefText('ready')+'\n');
							test.push('setOpText: '+statusbar.setOpText('waitings')+'\n');
							test.push('setVisible: '+statusbar.setVisible(true)+'\n');
							test.push('showTime: '+statusbar.showTime()+'\n');
							test.push('endShow: '+statusbar.endShow()+'\n');
							test.push('addScreenLock: '+statusbar.addScreenLock()+'\n');
							test.push('delScreenLock: '+statusbar.delScreenLock()+'\n');
							test.push('setCenter: '+statusbar.setCenter()+'\n');
							alert(test.join(''));
						}
	                });
	                statusbar = new ctp.ui.statusbar({
						id:'statusbar',
						renderTo:$('body'),
						defText : '已完成',	
						opText : '请等待。。。',
						isVisible:false
					});
					var buttonsLayout = new ctp.ui.gridlayout({
						id:'buttonsLayout',
	                    width: '98%',
	                    cols: 3,
	                    align: 'center',
	                    colSpace: 30,
	                    items: [
						     [{element: button1},{element: button2},{element: button3}]
						]
	                }); 
					var buttonsGroupbox=new ctp.ui.groupbox({
				  	    id: 'buttonsGroupbox',						
						items:[buttonsLayout],
						width:'100%',
						title:'功能测试区'						   
				     });
					new ctp.ui.panel({
	                    title: 'statusbar实例',
	                    collapsible: true,
	                    width: '550px',
	                    height: 'auto',
						align:'center',
						items:[buttonsGroupbox],
	                    renderTo: 'body'
	                });
					function statusbarStart(){
						statusbar.showTime({
							statusObj:'statusbar',
							opTimeValue:9000,
							boolScreen:true,
							boolAllScreen:true,
							timeOutValue:6000,
							wait:'等待',
							cancel:'取消'
						});
					}
					function startStatusbar(){
						statusbar.showTime({
							boolScreen:true,
							boolAllScreen:true
						});
						setTimeout(function(){
							statusbar.endShow(true);
						},3000);
					}
				});
		</script>
	</head>
	<body>
		<b>ctp.ui.statusbar 实例</b>
        <hr/>
        <br/>  
	</body>
</html>